package com.ty.springbootshiro.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ty.springbootshiro.entity.Right;
import com.ty.springbootshiro.entity.Role;
import com.ty.springbootshiro.entity.User;
import org.apache.ibatis.annotations.Param;


import java.util.List;


/**
 * RoleService
 *
 * @aurhor whs
 * @since 2024/10/16
 */
public interface RoleService  {

    List<Role> list();
    //角色增删改查
    public List<Role> findAllRoles();
    //权限查询
    public List<Right> findAllRights();
    public List<Right> findRightsByRole(Role role);


    Role saveRole(Role role);
    void deleteRole(@Param("roleId") Long roleId); // 删除
    Role getRole(@Param("roleId") Long roleId); // 按主键查询单条

    Page<Role> rolePage(@Param("roleName") String roleName, Page<Role> rolePager);

    // 根据用户查询角色对象
    Role findRoleByUsers(User user);



}
